#coding=utf-8

import pandas as pd
import numpy as np

df = pd.DataFrame({'A': 'foo bar foo bar foo bar foo foo'.split(),
                   'B': 'one one two three two two one three'.split(),
                   'C': np.arange(8), 'D': np.arange(8) * 2})
print(df)


print("----------------------")
value='foo'
df2=df[(df['A'] == value)] # 判断等式是否成立
# df.apply(lambda row: row["A"] == 'foo', axis=1)
print(df2)